package com.ladlee.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: dingchang
 * @Date: 2018/12/26 16:27
 * @Description:
 */
@RestController
public class PersonController {

    @GetMapping(value = "/persons")
    public Object info(){
        return SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
